package main

import (
	"fmt"
	"time"
)

func main() {

	ch := make(chan bool)

	taskChan := make(chan *Task , 10)
	go productor(taskChan)
	go customer(taskChan)
	<-ch

}

type Task struct {
	name string
}

func productor(ch chan *Task)  {
	for;;{
		t := &Task{name:"tttttttt"}
		ch<-t
		time.Sleep(time.Second * 2)
	}
}

func customer(ch chan *Task)  {
	for ; ;  {
		t := <-ch
		go func() {
			fmt.Println(*t)
		}()
	}
}